/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dabarobjects.mobile.database.types;

/**
 *
 * @author DabarObjects Solutions Limited (www.dabarobjects.com)
 */
public class IntegerObjectNotationParser extends AbstractMadexObjectNotationParser{

    public final static String TYPE_KEY = "nb";
    
    public String getObjectTypeKey() {
        return TYPE_KEY;
    }

    public Object parseObject(String dump) {
        try {
            return new Integer(Integer.parseInt(dump));
        } catch (Exception e) {
            return new Integer(0);
        }
    }

    public String notateObject(Object obj) {
        return "{".concat(obj.toString()).concat("}");
    }

}
